import React, {Component} from 'react';
import { Badge,Card,NoticeBar, Button,Scroller,Popup,Group, Field, Toast,NumberPicker, Context,SelectField, TextField  } from 'saltui';

// <>
export default class InputText extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
      value:this.props.value,
      placeholder:this.props.placeholder,
      id:this.props.id,
    };
  }

  handleTextChange = (id,value) =>{
    this.state.value = value;
    this.setState({value:this.state.value});
    this.props.onChange(value);
  }

  render(){
    return  <TextField
      readOnly = {this.props.readOnly}
      placeholder={this.state.placeholder}
      value={this.state.value}
      onChange={(value) => { this.handleTextChange('t1', value); }}
    />

  }

}
